<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>圣杯布局</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      html,
      body {
        height: 100%;
      }
      .container {
        min-height: 100%;
        display: flex;
        flex-direction: column;
        position: relative;
      }
      .header {
        height: 100px;
        background-color: red;
      }
      .body {
        flex: 1;
        background-color: blue;
        display: flex;
        flex-direction: row;
      }
      .footer {
        height: 100px;
        background-color: yellow;
      }
      .left,
      .right {
        width: 100px;
        background-color: green;
        padding-top: 100px;
      }
      .center {
        flex: 1;
        background-color: gray;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="header">1</div>
      <div class="body">
        <div class="left">2</div>
        <div class="center">3</div>
        <div class="right">4</div>
      </div>
      <div class="footer">5</div>
    </div>
  </body>
</html>
